package com.qf.lanzhou.shop.api.pay;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author Yeach-chen
 * @ClassName AlipayConfig
 */
public class AlipayConfig {
    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116695246";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDCFLuXviAdy4FYtDm+12skDEwZL3iHxzwsyMMDcFH0ueKw/u6X054nqo3pfCp1ZyfPlaUHQZQHTVRFYoBhJugWDxLYXXTlfgifXisOBvgIG/geNiKvJq4h6fWHI6i8ULr4N8ZD592vQWyyjAQdm6295ytzkG8JF8ZnCE58hf0REtslZ7tbIXOqedNeMkNqLZhOlen6TFK2cPr8UrlQupHuT4loHVL9ZjmZXgnWTAfDX47n1SxI632Qs+lAHgTHxQS9CLhNuqrB1k/ioDfNossutVlmsoAL8MIsLt1HPPHU/BKoQIBtR2AhYg9NMDrZrfpajGzteCgttZfe6rij2CsDAgMBAAECggEAIkyDspd5GYrjeweuxNlRJ/e8Yx8OkABX1BpOzIbHFRbcxybmh5JwetYbak31OvZWBMuPdK7UOE4kPHbh9Ulo7q0PSYmKpRwW7gM4XKxCnTxEJyKuEoIld/ze1Vkp8s3ZnRBOS6XoeZZ4XT19ZLYkiFEYTr4RwWugNokzRbJwPNnnZURMod0DRjPx9USPMy2sUfFf2hTmZEGinupiHaRmmjp4uM7c5OP44OIFkBNiDLCiRzOrhvXIgJhM/irpTeRqU/HhaSuDszIhcOVBTdinVi1aZ3SYH4gWMwMmJ79gK8Ii3jNb76oA7kzASpXIHEl44wUjfmBENRzeaOuokKSMcQKBgQDnf5RYRu1BtolT/pmlciO95mHtC01/mHPZ4ufvhazj3rWtibuucObwTlUeQ4NgoqQqqe3KLuNCE3xER51Gk0ytOHELR6cVHKoo+lvj0cTJ9jrTpgM0FvfZN1oRS/vr2ItMdPPfEvWzMpu/2tK7DfoJg38qBD4S6o2kigtH8NIh3QKBgQDWn1WIhKxSxX7iGp9ezbaq5L1XnPnGUN6yIPRKvjjdQnWABf/ood/AA0/coSFIvsynqQ/FmL5JZ+ReUX4lf3NXdzzNLtCBB33U4aos7NaB+dKc/MiXl205KrvABqAdCW4yRySez3e5ZGpNsXJCyghCyb69PcFMRNs38dlDP5NiXwKBgDdH7gLOnSWOE2ktaT9q7EIS29uhUVZg73leiAhYoZqguj3AoELdzygfbJAXiy3uaMmPXqtjWv2SbaBYgaQy1KKg0c3hxHJ0L+YtMvhKRXX9CLs175nmyjTi1O1Aed4uDcWqP/pLKsUqFqtP8/abNdRDxIAiFzipLj3WgS8iwOs5AoGACWfCH9Fwm8/713zDLyxkrOiJQ6WlbINuvu+ixQPBCjE3ZPzeUhuF6qw6e7iz9LQn09Ec19PxwtXCtD9t/8auD08yYuuCR6VEZmfdRUq7u8Zu7GJHiB0itDajM68WpS8cnSdw+2SsInu8DNuR3ktsQUEGEtT5+5Wo5bK7iq7mjpECgYAQWBHxxNplsU4s7VQhzhEf3Pn/e1yFwiJ4amZt98ka3IRcvXUNI053YeWgQJgywC4MkXB0mpgpEdb7LPGU4HOWhmTq3r+8pDdrXKY+foNtYGoiCPbftg12LjH9rhFg03fWiMhpGdTPzTM9Zjndk5IFr193V796wxchXHMpxOuvaA==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Eughf389/NX4wp7UtIeJEqoSu2T8RtQ6tTkqZTaAOZW5CzC1Npc7+R+2ws3pU0UmxdAu4T3adAoI2MRCLKmg0fX97mgUVdUL8I67vNjpPBhAgifKnnDcHxFaz5y6lCQ8vervyxfzgq3OSXe8FdWNqvHnyg7fkUZQ6ncJ9JEDtgi2mUukXEi7fIuwYX3u3VA1H2wf8VSAcV8QJCqjeIoR/uIwmeVqDINKfsPps/hby7muapUkFYFmsFqv7FkAcMX5JleTSQzSiuEnEOvJWq1cEhheNP/F7ECmarA6ZJYNIfBeaSwNn43uHZ5u8CxHqqEOtKmaWvST1I4ueLYfYQ5HQIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://367471vr69.zicp.vip/shop_api/pay_success";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/view_api/index.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


    //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
